package com.watson.todolist;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

/**
 * This is the splash page that functions to show our teams logo before the
 * program begins.
 * 
 * @author Jasmin Muminhodzic
 * @version 1.0
 * 
 */
public class splashPage extends Activity {

	/**
	 * This method is called when the activity is created.
	 * 
	 * @param savedInstanceState
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.splashpagelayout);

		Thread timer = new Thread() {
			// Thread to show the splash screen, then launch the main screen
			@Override
			public void run() {
				try {
					sleep(5000); // set this to how long you want to wait before
									// showing the main screen
				} catch (InterruptedException e) {
					e.printStackTrace();
				} finally {
					String activityPackageName = mainLoginPage.class
							.getPackage().getName();
					String activityClassName = mainLoginPage.class.getName();
					Intent mainActivity = new Intent();
					mainActivity.setClassName(activityPackageName,
							activityClassName);
					startActivity(mainActivity);

				}
			}
		};
		timer.start();
	}
}
